<template>
  <el-form-item label="文本显示方式：">
    <el-select v-model="tempValue">
      <el-option v-for="(item, idx) in list" :key="idx" :label="item.name" :value="item.value"></el-option>
    </el-select>
  </el-form-item>
</template>

<script>
export default {
  name: 'attr-sxc-textDisType',
  props: {
    textDisType: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {
      tempValue: 1,
      list: [{
        name: '静态文本',
        value: 1
      }, {
        name: '向上滚动',
        value: 2
      }, {
        name: '向下滚动',
        value: 3
      }, {
        name: '向左滚动',
        value: 4
      }, {
        name: '向右滚动',
        value: 5
      }]
    }
  },
  mounted() {
    this.tempValue = this.textDisType
  },
  watch: {
    textDisType() {
      this.tempValue = this.textDisType
    },
    tempValue() {
      this.$emit('update:textDisType', this.tempValue)
    }
  }
}
</script>

<style scoped>
</style>
